package com.xingda.packing.events.lister;

import com.google.common.eventbus.Subscribe;
import com.xingda.packing.events.dto.EventLedMessage;
import com.xingda.packing.led.LedOperateService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class LedLister {

    @Resource
    LedOperateService ledOperateService;

    @Subscribe
    public void send(EventLedMessage eventLedMessage) {
        ledOperateService.write(eventLedMessage.getMessage(), eventLedMessage.getIp(), eventLedMessage.getPort());
    }

}
